class CreateUser < ActiveRecord::Migration
  def self.up
    #users
     create_table :users, :force => true do |t|
        t.string  :username, :limit=> 100, :null => false         # user name
        t.string  :password, :null => false                       # hash password
        t.string  :name, :limit => 100                            # real name
        t.string  :gender, :default => "Male"                     # gender 1 means male
        t.string  :email                                          # contact email
        t.string  :company                                        # company name

        t.string  :role, :default => "Designer"                   # default is Designer
        t.string  :is_vip, :default => "No"                       # default is common user
        t.string  :salt                                           # generate for hash password
        t.string   :activation_code                               # activation code for account
        t.datetime :activated_at                                  # activated time

        t.timestamps
     end
  end

  def self.down
    drop_table :users
  end
end
